﻿
@model deviceManage.Models.LendLog
@{
    Layout = null;
}

<div class="layui-form" lay-filter="returnForm" style="padding: 20px 30px 0 0;">
    <input type="hidden" name="id" value="@Model.Id"/>
    <div class="layui-form-item">
        <label class="layui-form-label">设备名称</label>
        <div class="layui-input-inline" style="width:400px;">
            <input type="text" readonly="readonly"   value="@Model.Device.Name"
                   autocomplete="off" class="layui-input layui-form-danger" maxlength="100">
        </div>
    </div>
     
    <div class="layui-form-item">
        <label class="layui-form-label">归还时间</label>
        <div class="layui-input-inline">
            <input type="text" name="ReturnDate" value="" lay-verify="required" readonly id="returnDate"
                   placeholder="归还时间" autocomplete="off" class="layui-input date">
        </div>

    </div>

    
    <div class="layui-form-item">
        <label class="layui-form-label">归还人</label>
        <div class="layui-input-inline">
            <input type="text" name="ReturnUser" lay-verify="required" placeholder="归还人"
                   autocomplete="off" class="layui-input layui-form-danger" maxlength="15">
        </div>
    </div>

    <div style="text-align:center;">
        <input type="button" lay-submit="" lay-filter="returnBtn" value="确认" class="layui-btn">
    </div>
</div>
<script type="text/javascript">
    form.render("", 'returnForm');
    laydate.render({
        'elem': '#returnDate'
    });


    //监听提交
    form.on('submit(returnBtn)', function (data) {
        var field = data.field; //获取提交的字段 
        //提交 Ajax 成功后，关闭当前弹层并重载表格
        $.post("/deviceLend/ReturnDevice", field, function (d) {
            layer.msg(d.msg);
            if (d.code == 1) {
                layer.close(winIndex); tableObj.reload();
            }
        });

    });
</script>